package com.ujson.chat.server.listener;

import com.ujson.base.common.utils.LogUtil;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <h3>ujson-parent</h3>
 * <p>server端连接监听器</p>
 *
 * @author JerryLiu  a1031757312@gmail.com
 * @version 1.0
 * @date 2021-11-28 21:28
 */
@Slf4j
@Service
public class ServerConnectionListener implements GenericFutureListener {
    @Override
    public void operationComplete(Future future) throws Exception {
        if (future.isSuccess()) {
            LogUtil.info(log, "netty server start success.");
        } else {
            LogUtil.error(log, "netty server start failed.", future.cause());
        }
    }
}
